﻿using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class Login : MonoBehaviour
{
    public InputField m_inputfield;
    public Button m_button;

    // 加载脚本实例时调用 Awake
    private void Awake()
    {
        try
        {
            m_inputfield.text = PlayerPrefs.GetString("Name");
        }
        catch (System.Exception e)
        {
            Debug.Log(e.Message);
        }

        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        m_button.onClick.AddListener(() =>
        {
            Fuck.s_strVMID = m_inputfield.text;
            PlayerPrefs.SetString("Name", Fuck.s_strVMID);
            SceneManager.LoadScene(1);
        });

        m_inputfield.Select();
    }
}
